package com.jsgt.greekfire.bean

import android.os.Parcel
import android.os.Parcelable

/**
 * author fhx
 * create time 2020/4/24 10:09
 **/
class BillBean() : Parcelable {
    var guid: String? = null
    var userGuid: String? = null
    var assetGuid: String? = null
    var createTime: String? = null
    var assetBefore: String? = null
    var assetEvent: Int? = null//1 充币  2 提现 3 买入 4 卖出 5 转账 6 收款 11 抢购
    var assetAmt: Float? = null
    var assetAfter: Float? = null
    var userWallet: WalletInfoBean? = null
    var block: BlockBean? = null
    var updatedAt: String? = null
    var money: Double? = null
    var address: String? = null
    var serviceFee: String? = null
    var remark: String? = null
    var status: Int? = null//1、已提交 2、已完成 3、已拒绝
    var assetEventStr:String?=null
    var direction :Int?=null
    constructor(parcel: Parcel) : this() {
        guid = parcel.readString()
        userGuid = parcel.readString()
        assetGuid = parcel.readString()
        createTime = parcel.readString()
        assetBefore = parcel.readString()
        assetEvent = parcel.readValue(Int::class.java.classLoader) as? Int
        assetAmt = parcel.readValue(Float::class.java.classLoader) as? Float
        assetAfter = parcel.readValue(Float::class.java.classLoader) as? Float
        userWallet = parcel.readParcelable(WalletInfoBean::class.java.classLoader)
        block = parcel.readParcelable(BlockBean::class.java.classLoader)
        updatedAt = parcel.readString()
        money = parcel.readValue(Double::class.java.classLoader) as? Double
        address = parcel.readString()
        serviceFee = parcel.readString()
        remark = parcel.readString()
        status = parcel.readValue(Int::class.java.classLoader) as? Int
        assetEventStr=parcel.readString()
        direction=parcel.readValue(Int::class.java.classLoader) as? Int
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(guid)
        parcel.writeString(userGuid)
        parcel.writeString(assetGuid)
        parcel.writeString(createTime)
        parcel.writeString(assetBefore)
        parcel.writeValue(assetEvent)
        parcel.writeValue(assetAmt)
        parcel.writeValue(assetAfter)
        parcel.writeParcelable(userWallet, flags)
        parcel.writeParcelable(block, flags)
        parcel.writeString(updatedAt)
        parcel.writeValue(money)
        parcel.writeString(address)
        parcel.writeString(serviceFee)
        parcel.writeString(remark)
        parcel.writeValue(status)
        parcel.writeString(assetEventStr)
        parcel.writeValue(direction)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<BillBean> {
        override fun createFromParcel(parcel: Parcel): BillBean {
            return BillBean(parcel)
        }

        override fun newArray(size: Int): Array<BillBean?> {
            return arrayOfNulls(size)
        }
    }

}

class BlockBean() : Parcelable {
    var guid: String? = null
    var node: String? = null
    var higth: String? = null

    constructor(parcel: Parcel) : this() {
        guid = parcel.readString()
        node = parcel.readString()
        higth = parcel.readString()
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(guid)
        parcel.writeString(node)
        parcel.writeString(higth)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<BlockBean> {
        override fun createFromParcel(parcel: Parcel): BlockBean {
            return BlockBean(parcel)
        }

        override fun newArray(size: Int): Array<BlockBean?> {
            return arrayOfNulls(size)
        }
    }


}